package org.example.lambda;

import org.example.entity.Person;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author why
 * @date 2022/11/1512:19
 */

public class StreamExample {



    public static void main(String[] args) {
        List<Person> personList = Arrays.asList(
                new Person("Cheng","fen",1),
                new Person("Cheng","fen",2),
                new Person("Xiao","Can",3),
                new Person("Chang","yang",4),
                new Person("Clin","Yang",5),
                new Person("Lin","Cang",6)
        );

        // parallelStream 可以冰箱执行
        personList.parallelStream().forEach(person -> System.out.println(person.getAge()));
        System.out.println("=================");
        personList.parallelStream().forEach(person -> System.out.println(person.getAge()));


        StreamExample streamExample = new StreamExample();
        streamExample.test();
//        streamExample.test();

    }
    List<String> ids = new ArrayList<>();
    public void test(){

//        Person person = new Person("a", "b", 12);
//
//        List<Person> list1 = new ArrayList<>();
//        List<Person> list2 = new ArrayList<>();
//
//        list1.add(person);
//
//        list2.addAll(list1);
//
//        person.setAge(111111111);
//
//        System.out.println(list1);
//        System.out.println(list2);






    }



}